<?php

namespace app\common\model\Business;

use think\Model;

class Fans extends Model
{
    //
    protected $name = "business_fans";

    protected $append = [
        'fans_list'
    ];


    // 粉丝
    public function getFansListAttr($value, $data)
    {
        $fans = $data['fans'];

        if(empty($fans))
        {
            return [];
        }

        //把字符串转换数组
        return explode(',', $fans);
    }
}
